{% extends '::base.html.twig' %} 
{% block module_name %}Reservas{% endblock %}
{% block title %}Reservas :: Listar{% endblock %}
{% block customScripts %}
<script src='{{ asset('bundles/EndorBundle/js/jquery.dataTables.min.js') }}'></script>
{% endblock %}
{% block body %}
<h2>Reservas :: Listar</h2>
<div class="widget_inside">
    <table class="records_list regular">
        <thead>
            <tr>                    <!--<th>Id</th>-->
                <th>Fecha de salida</th>
                <th>Bodega</th>
                <th>Art&iacute;culo</th>
                <th>Cantidad</th>
                <th>Cliente</th>
                <th>Estado</th>
                <th>Fecha de reserva</th>
                <th style="width: 100px;">Acciones</th>
                </tr>
            </thead>
            <tbody>
    {% for entity in entities %}
                    <tr>
                        <!--<td><a href="{{ path('reservas_show', { 'id': entity.id }) }}">{{ entity.id }}</a></td>-->
                        <td>{% if entity.fechaSalida %}{{ entity.fechaSalida|date('d/m/Y H:i') }}{%else%}N/A{% endif%}</td>
                        <td>{{ entity.Bodega.nombre}}</td>
                        <td>{{ entity.Articulo }}</td>
                        <td>{{ entity.cantidad }}</td>
                        <td>{{ entity.Cliente.nombre }}</td>
                        <td>{{ entity.EstadoReserva.nombre }}</td>
                        <td>{{ entity.fechaReserva|date('d/m/Y H:i') }}</td>
                        <td>    
                            <a href="{{ path('reservas_show', { 'id': entity.id }) }}" class="button small">Ver</a>    
                            <a href="{{ path('reservas_edit', { 'id': entity.id }) }}" class="button small">Editar</a>
                        </td>
                    </tr>
    {% endfor %}
                    </tbody>
                </table>
                        <div class="margin_top_15 right">
                    <a href="{{ path('reservas_new') }}" class="blue button">Agregar</a>
                </div>
                    </div>
<script>
$(document).ready(function(){
    $('.regular').dataTable();
});
</script>
{% endblock %}